def generate_prompt_group1(batch, name, input=None):
    def generate_instruction(data, prompt_type=None):
        error_code = data["incorrect_solutions"]
        code_language = data["code_language"]
        public_tests_input = data["public_tests_input"]
        public_tests_output = data["public_tests_output"]
        if prompt_type == "cot":
            instruction = f"""
Given a programming task and its incorrect {code_language} solution, your task is to fix up the incorrect solution according to the test case and provide the correct, executable {code_language} solution.

Note: You have to output the correct solution exactly as the output format requires, the output format must meet the following requirements:
- Explain your reasoning in <think></think> tags.
- In your response, the final answer should be in the following format: <think>(reasoning)</think><answer>```code```</answer>.
- put the correct solution between <answer>```code and ```</answer> to format the code.
- You cannot change the form of the incorrect solution, just fix it.
- Solve this step by step.

Incorrect_Solution:
{error_code}

Correct the code and ensure it passes the following test case:
Input: {public_tests_input}
Output: {public_tests_output}
            """
        else:
            instruction = f"""
Write a solution to the following coding problem:
You are assigned the task of correcting the {code_language} buggy code. Ensuring that your corrected code adheres to the specified programming language syntax and logic requirements. Validate your solution against the provided test cases to ensure its accuracy. Note that:
1. Your solution should strictly consist of the corrected code only. 
2. You must wrap your code using ```.

Below is the buggy code snippet:
{error_code}

Correct the code and ensure it passes the following test case:
Input: {public_tests_input}
Output: {public_tests_output}
            """
        return instruction

    batch_prompts = []
    batch_size = len(batch["idx"])  # get batch_size, the last batch may not be full
    for idx in range(batch_size):

        if input == "zero":
            prompt = ""
        elif input == "three":
            with open(
                f"../few_shot_prompt/open/debug/prompt_debug_{name}.txt", "r"
            ) as f:
                prompt = f.read()
        new_dict = {}
        for key, values in batch.items():
            new_dict[key] = values[idx]
        # Get the instruction
        instruction = generate_instruction(new_dict, input)

        if name == "wizardcoder" or name == "deepseek":
            prompt += f"""Below is an instruction that describes a task. Write a response that appropriately completes the request.

### Instruction:
{instruction}

### Response:
"""
        elif name == "magicoder":
            prompt += f"""You are an exceptionally intelligent coding assistant that consistently delivers accurate and reliable responses to user instructions.

@@ Instruction
{instruction}

@@ Response
"""
        elif name == "codefuse":
            HUMAN_ROLE_START_TAG = "<|role_start|>human<|role_end|>"
            BOT_ROLE_START_TAG = "<|role_start|>bot<|role_end|>"
            prompt += f"{HUMAN_ROLE_START_TAG}{instruction}{BOT_ROLE_START_TAG}"

        elif name == "octocoder" or name == "codellama":
            prompt += f"""Question: {instruction} \n\nAnswer:"""

        elif name == "phind":
            prompt += f"""
### System Prompt
You are an intelligent programming assistant.

### User Message
{instruction}

### Assistant
"""
        elif name == "codellama-inst":
            prompt += f"<s>[INST] {instruction.strip()} [/INST]"

        else:
            prompt = instruction

        batch_prompts.append(prompt)
        # print("Prompt:", prompt)

    return batch_prompts
